const express = require("express")
let app = express();
let news = require("./data.json")
app.get("/list", (req, res) => {
  console.log(111);
  res.json(news)
})
app.get("/detail", (req, res) => {
  console.log("222");
  let { id } = req.query;
  let reslut = news.find(item => item.id == id);
  res.json(reslut);
})
app.listen(8989)